#!/bin/bash

:<<eof

1. 基本语法

if [ condition ];then
	...
elif [ condition ];then
	...
else
	...
fi

或者 

if [ condition ]
then
	...
elif [ condition ]
then
	...
else
	...
fi

注意事项：

①  [ condition ]，中括号和条件判断式之间必须有空格
②  if 后面要有空格



eof


# 命令出错会停止执行
set -e
# 打印每条执行的命令
set -x

if [ $1 -eq 1 ];then
	echo "it's 1"
elif [ $1 -eq 2 ];then
	echo "it's 2"
else
	echo "it's nothing"
fi


set +x
